package org.liveboardgames.agricola.model.enums;

public class FarmElementEnum {

  public static final String WOODEN_ROOM = "WOODEN_ROOM";

  public static final String CLAY_ROOM = "CLAY_ROOM";

  public static final String STONE_ROOM = "STONE_ROOM";

  public static final String FIELD = "FIELD";

  public static final String STABLE = "STABLE";

  public static boolean isRoom(String farmElement) {
    return WOODEN_ROOM.equals(farmElement) || CLAY_ROOM.equals(farmElement) || STONE_ROOM.equals(farmElement);
  }

  public static String getRoomFromMaterial(String material) {
    String result = null;

    if (HouseTypeEnum.WOODEN.equalsIgnoreCase(material)) {
      result = WOODEN_ROOM;
    }
    else if (HouseTypeEnum.CLAY.equalsIgnoreCase(material)) {
      result = CLAY_ROOM;
    }
    else if (HouseTypeEnum.STONE.equalsIgnoreCase(material)) {
      result = STONE_ROOM;
    }

    return result;
  }

  public static String getRoomMaterial(String room) {
    String result = null;

    if (WOODEN_ROOM.equalsIgnoreCase(room)) {
      result = HouseTypeEnum.WOODEN;
    }
    else if (CLAY_ROOM.equalsIgnoreCase(room)) {
      result = HouseTypeEnum.CLAY;
    }
    else if (STONE_ROOM.equalsIgnoreCase(room)) {
      result = HouseTypeEnum.STONE;
    }

    return result;
  }
}
